package com.zc.test;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

import java.util.Objects;

/**
 * @program: Selenium
 * @description: SeleniumDemo
 * @author: zengchen
 * @create: 2021-07-14 21:09
 **/
public class SeleniumDemo {

    public static void main(String[] args) {
//        System.setProperty("webdriver.firefox.bin", "D:\\software\\firefox\\firefox.exe");

        System.setProperty("webdriver.gecko.driver", "D:\\sme\\geckodriver.exe");
        System.setProperty("webdriver.chrome.driver","D:\\sme\\chromeDriver.exe");
        WebDriver driver = new ChromeDriver();

        openTaobao(driver);


    }


    public static void openTaobao(WebDriver driver){
        driver.navigate().to("https://login.taobao.com/member/login.jhtml?spm=a21bo.21814703.754894437.1.5af911d9DkPA4o&f=top&redirectURL=https%3A%2F%2Fwww.taobao.com%2F");
        driver.findElement(By.id("fm-login-id")).sendKeys("zc20120902");
        driver.findElement(By.id("fm-login-password")).sendKeys("*********");
        driver.findElement(By.className("password-login")).click();
    }

}
